<template>
    <div class="swiper-container" :class="slideWrap">
        <div class="swiper-wrapper">
            <div
                class="swiper-slide"
                v-for="item in listImg">
                <img :src="item.img">
            </div>
        </div>
        <div class="swiper-pagination"></div>
    </div>
</template>
<script>
import Swiper from 'swiper';
import 'swiper/dist/css/swiper.min.css';

export default {
    name:'Banner',
    props: {
        listImg:{
            type:Array,
            default:''
        },
        slideWrap:{
            type:String,
            default:''
        }
    },
    mounted() {
        var swiper = new Swiper('.swiper-container', {
            pagination: '.swiper-pagination',
            paginationClickable: true,
            loop: true,
            speed: 600,
            autoplay: 4000,
            onTouchEnd: function() {
                swiper.startAutoplay()
            }
        });
    }
}
</script>
<style lang="less">
.swiper-container {
    width: 100%;
    height: 10rem;
    .swiper-wrapper {
        width: 100%;
        height: 100%;
    }
    .swiper-slide {
        background-position: center;
        background-size: cover;
        width: 100%;
        height: 100%;
        img {
            width: 100%;
            height: 100%;
        }
    }

}
</style>
